home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Draw / Sources / DrwDDCmd.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.4 KB  |  122 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrwDDCmd.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Mary Boetcher
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRWDDCMD_H
  13. #define DRWDDCMD_H
  14.  
  15. // ----- FrameWork Includes -----
  16.  
  17. #ifndef FWDRCMD_H
  18. #include "FWDrCmd.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. class CDrawPart;
  26. class CDrawSelection;
  27. class CDrawSubscribeLink;
  28. class CDrawLinkManager;
  29. class CBaseShape;
  30. class CDrawContent;
  31.  
  32. //========================================================================================
  33. // class CDrawDragCommand - for dragging
  34. //========================================================================================
  35.  
  36. class CDrawDragCommand : public FW_CDragCommand
  37. {
  38.   public:
  39.  
  40.     FW_DECLARE_AUTO(CDrawDragCommand)
  41.  
  42.     CDrawDragCommand(Environment* ev, 
  43.                      CDrawPart* part,
  44.                      FW_CFrame* frame,
  45.                      CDrawSelection* selection,
  46.                      FW_Boolean canUndo);
  47.  
  48.     virtual ~CDrawDragCommand();
  49.  
  50.     // --- FW_CCommand overrides
  51.     virtual void         UndoIt(Environment* ev);            // Override
  52.     virtual void         RedoIt(Environment* ev);            // Override
  53.     virtual void         SaveUndoState(Environment* ev);        // Override
  54.     virtual void         FreeUndoState(Environment *ev);    // Override
  55.  
  56.   protected:
  57.     CDrawPart*            fDrawPart;
  58.     CDrawSelection*        fDrawSelection;
  59.     CDrawContent*        fDraggedContent;
  60.     ODShape*            fUpdateShape;
  61. };
  62.  
  63. //========================================================================================
  64. // class CDrawDropCommand - for dropping
  65. //========================================================================================
  66.  
  67. class CDrawDropCommand : public FW_CDropCommand
  68. {
  69.   public:
  70.   
  71.     FW_DECLARE_AUTO(CDrawDropCommand)
  72.  
  73.     CDrawDropCommand(Environment* ev, 
  74.                      CDrawPart* itsPart,
  75.                      FW_CFrame* frame,
  76.                      ODDragItemIterator* dropInfo, 
  77.                      ODFacet* facet, 
  78.                      const FW_CPoint& windowPoint,
  79.                      FW_Boolean canUndo);
  80.  
  81.     virtual ~ CDrawDropCommand();
  82.  
  83.     virtual void             UndoIt(Environment* ev);            // Override
  84.     virtual void             RedoIt(Environment* ev);            // Override
  85.     virtual void             CommitUndone(Environment *ev);        // Override
  86.     virtual void             SaveRedoState(Environment* ev);        // Override
  87.     virtual void             FreeRedoState(Environment* ev);        // Override
  88.  
  89.     // --- FW_CDropCommand overrides
  90.     virtual FW_Boolean         DoDrop(Environment* ev, 
  91.                                 ODStorageUnit* dropSU, 
  92.                                 const FW_CPoint& mouseDownOffset, 
  93.                                 const FW_CPoint& dropPoint, 
  94.                                 FW_Boolean isDropMove,
  95.                                 short itemNumber);
  96.                                 
  97.     virtual FW_Boolean        DoDroppedInSameFrame(Environment* ev, 
  98.                                 ODStorageUnit* dropSU, 
  99.                                 const FW_CPoint& mouseDownOffset, 
  100.                                 const FW_CPoint& dropPoint);
  101.                                 
  102.     virtual void             DoDroppedPasteAs(Environment* ev, 
  103.                                 const FW_CPoint& mouseDownOffset,
  104.                                 const FW_CPoint& dropPoint);    // Override
  105.  
  106.   private:
  107.     void                     OffsetSelection(Environment* ev, const FW_CPoint& delta);
  108.     void                     RestoreDroppedShapes(Environment* ev);
  109.  
  110.     CDrawLinkManager*         GetDrawLinkManager(Environment* ev) const;
  111.  
  112.   private:
  113.     CDrawPart*                fDrawPart;
  114.     CDrawSelection*            fDrawSelection;
  115.     FW_CPoint                fDropDelta;
  116.     CDrawContent*            fDroppedContent;
  117.     CDrawSubscribeLink*        fSavedLink;
  118. };
  119.  
  120.  
  121. #endif
  122.